﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace StoreWeb.ajax
{
    public partial class comment : System.Web.UI.Page
    {
        Maticsoft.BLL.comment cmdbll = new Maticsoft.BLL.comment();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["action"]) && Request["action"] == "comment")
                {
                    HttpCookie cookie = Request.Cookies["UserLogin"];
                    Maticsoft.Model.comment cmt = new Maticsoft.Model.comment();
                    cmt.createtime = DateTime.Now;
                    cmt.dealersmanageid = cookie.Values["dmid"];
                    cmt.ordercode = Request["ordercode"];
                    cmt.productcmt = Request["prductcmt"];
                    cmt.servicecmt = Request["servicecmt"];
                    cmt.advice = Request["advice"];
                    cmt.note = Request["note"];
                    Response.Write(cmdbll.Add(cmt) > 0 ? "1" : "0");
                }
            }
        }
    }
}